<template>
  <div>
    用户名: <input type="text" v-model="ename"> <br>
    密码 : <input type="password" v-model="pwd"> <br>
    <button @click="doLogin">登录</button>
  </div>
</template>

<script>
  export default {
    name: "LoginEmp",
    data() {
      return {
        ename: "",
        pwd: ""
      }
    }, methods: {
      doLogin() {
        var vm = this;
        this.axios({
          url: "http://localhost:8081/emp/doLogin",
          method: "post",
          params: {
            ename: vm.ename,
            pwd: vm.pwd
          }
        }).then(x => {
          alert(x.data)
          vm.$router.push("/EmpPage")
        })
      }
    }
  }
</script>

<style scoped>

</style>
